import requests from "./requests";

// 分页查询接口
export const selectUserAPI = (params) => {
    return requests({
        method: 'get',
        url: '/user/selectuser',
        params
    })
}
// 新增接口
export const insertAPI = (data) => {
    return requests({
        method: 'post',
        url: '/user/insert',
        data
    })
}
// 判断用户名是否唯一接口
export const getOneAPI = (params) => {
    return requests({
        method: 'get',
        url: '/user/getOne',
        params
    })
}

// id查询接口
export const selectidAPI = (params) => {
    return requests({
        method: 'get',
        url: '/user/selectid',
        params
    })
}
// 批量删除接口
export const deletUserAPI = (data) => {
    return requests({
        method: 'delete',
        url: '/user/deletuser',
        data
    })
}
// 编辑接口
export const updateUserAPI = (data) => {
    return requests({
        method: 'put',
        url: '/user/update',
        data
    })
}


// 角色设置接口
export const grantPowerAPI = (params, roleIds) => {
    return requests({
        method: 'post',
        url: '/user/grantPower',
        params: {
            userId: params,
        },
        data: roleIds
    })
}